﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="myPoints.ascx.cs" Inherits="webUserControl_myPoints" %>
<%@ Register assembly="Infragistics2.WebUI.UltraWebGrid.v8.1, Version=8.1.20081.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebGrid" tagprefix="igtbl" %>
<%@ Register assembly="Infragistics2.WebUI.UltraWebGrid.ExcelExport.v8.1, Version=8.1.20081.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebGrid.ExcelExport" tagprefix="igtblexp" %>
<asp:Panel ID="Panel2" runat="server" Visible="False">
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:LinFen %>" 
    
    
        
        
        SelectCommand="SELECT CityName AS 城市, DistrictName AS 分区, ClassName AS 类别, DangCiName AS 档次, SupplierName AS 点位提供商, SupplierName2 AS 楼层, NumMale AS 男, NumFemale AS 女, NumHongGan AS 烘干机, NumBaoJian AS 包间, NumQiTa AS 其他, inTime AS 开始时间, endTime AS 结束时间, ID, SupplierID, isType AS 类型 FROM vw_OrderDetail WHERE (CustomerID = @CustomerID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="CustomerID" QueryStringField="cID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <div class="code">
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:LinFen %>" 
            SelectCommand="SELECT CityName AS 城市, DistrictName AS 分区, ClassName AS 类别, DangCiName AS 档次, SupplierName AS 点位提供商, SupplierName2 AS 楼层, NumMale AS 男, NumFemale AS 女, NumHongGan AS 烘干机, NumBaoJian AS 包间, NumQiTa AS 其他, inTime AS 开始时间, endTime AS 结束时间, ID, SupplierID, isType AS 类型 FROM vw_OrderDetail WHERE (CustomerID = @CustomerID) and (supplierID=@supplierID)">
            <SelectParameters>
                <asp:QueryStringParameter Name="CustomerID" QueryStringField="cID" 
                    Type="Int32" />
                <asp:ControlParameter ControlID="tbCode" Name="supplierID" 
                    PropertyName="Text" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:LinFen %>" 
            SelectCommand="SELECT CityName AS 城市, DistrictName AS 分区, ClassName AS 类别, DangCiName AS 档次, SupplierName AS 点位提供商, SupplierName2 AS 楼层, NumMale AS 男, NumFemale AS 女, NumHongGan AS 烘干机, NumBaoJian AS 包间, NumQiTa AS 其他, inTime AS 开始时间, endTime AS 结束时间, ID, SupplierID, isType AS 类型 FROM vw_OrderDetail WHERE (CustomerID = @CustomerID) and ([SupplierName] LIKE '%' + @SupplierName + '%')">
            <SelectParameters>
                <asp:QueryStringParameter Name="CustomerID" QueryStringField="cID" 
                    Type="Int32" />
                <asp:ControlParameter ControlID="tbName" Name="SupplierName" 
                    PropertyName="Text" />
            </SelectParameters>
        </asp:SqlDataSource>
        点位编号：<asp:TextBox ID="tbCode" runat="server"></asp:TextBox> 点位名称：<asp:TextBox 
            ID="tbName" runat="server"></asp:TextBox>
        <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" Text="查找" />
    </div>
    <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
        BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" 
        Caption="&lt;font color=black&gt;我的点位分布信息&lt;/font&gt;" CaptionAlign="Top" 
        CellPadding="4" Font-Size="12px" 
        Width="100%" onrowcommand="GridView2_RowCommand">
        <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
        <RowStyle BackColor="White" ForeColor="#330099" HorizontalAlign="Center" />
        <Columns>
            <asp:BoundField DataField="SupplierID" HeaderText="编号" 
                SortExpression="SupplierID" />
            <asp:BoundField DataField="类型" HeaderText="类型" SortExpression="类型" />
            <asp:BoundField DataField="城市" HeaderText="城市" SortExpression="城市" />
            <asp:BoundField DataField="分区" HeaderText="分区" SortExpression="分区" />
            <asp:BoundField DataField="类别" HeaderText="类别" SortExpression="类别" />
            <asp:BoundField DataField="档次" HeaderText="档次" SortExpression="档次" />
            <asp:BoundField DataField="点位提供商" HeaderText="点位名称" SortExpression="点位提供商" />
            <asp:BoundField DataField="楼层" HeaderText="楼层" SortExpression="楼层" />
            <asp:BoundField DataField="男" HeaderText="男" SortExpression="男" />
            <asp:BoundField DataField="女" HeaderText="女" SortExpression="女" />
            <asp:BoundField DataField="烘干机" HeaderText="烘干机" SortExpression="烘干机" />
            <asp:BoundField DataField="包间" HeaderText="包间" SortExpression="包间" />
            <asp:BoundField DataField="其他" HeaderText="其他" SortExpression="其他" />
            <asp:BoundField DataField="开始时间" DataFormatString="{0:d}" HeaderText="开始时间" 
                SortExpression="开始时间" />
            <asp:BoundField DataField="结束时间" DataFormatString="{0:d}" HeaderText="结束时间" 
                SortExpression="结束时间" />
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:Button ID="Button1" runat="server" CausesValidation="False" 
                        CommandArgument='<%# Eval("id") %>' CommandName="shifang" Text="释放该点位" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" 
            HorizontalAlign="Center" />
    </asp:GridView>
</asp:Panel>
<asp:Panel ID="Panel1" runat="server" Visible="False">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:LinFen %>" 
    
    
        
        
        SelectCommand="SELECT CityName AS 城市, DistrictName AS 分区, ClassName AS 类别, DangCiName AS 档次, SupplierName AS 点位提供商, SupplierName2 AS 楼层, NumMale AS 男, NumFemale AS 女, NumHongGan AS 烘干机, NumBaoJian AS 包间, NumQiTa AS 其他, inTime AS 开始时间, endTime AS 结束时间, isType AS 类型, Addre as 地址 FROM dbo.vw_OrderDetail WHERE (CustomerID = @CustomerID)">
        <SelectParameters>
            <asp:CookieParameter CookieName="cCustomerID" Name="CustomerID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" 
        DataSourceID="SqlDataSource1" Height="200px" Visible="False" Width="325px">
        <bands>
            <igtbl:UltraGridBand>
                <addnewrow view="NotSet" visible="NotSet">
                </addnewrow>
                <Columns>
                    <igtbl:UltraGridColumn BaseColumnName="城市" IsBound="True" Key="城市">
                        <Header Caption="城市">
                        </Header>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="分区" IsBound="True" Key="分区">
                        <Header Caption="分区">
                            <RowLayoutColumnInfo OriginX="1" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="1" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="地址" IsBound="True" Key="地址">
                        <Header Caption="地址">
                            <RowLayoutColumnInfo OriginX="1" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="1" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="类型" IsBound="True" Key="类型">
                        <Header Caption="类型">
                            <RowLayoutColumnInfo OriginX="2" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="2" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="类别" IsBound="True" Key="类别">
                        <Header Caption="类别">
                            <RowLayoutColumnInfo OriginX="2" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="2" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="档次" IsBound="True" Key="档次">
                        <Header Caption="档次">
                            <RowLayoutColumnInfo OriginX="3" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="3" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="点位提供商" IsBound="True" Key="点位提供商">
                        <Header Caption="点位提供商">
                            <RowLayoutColumnInfo OriginX="4" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="4" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="楼层" IsBound="True" Key="楼层">
                        <Header Caption="楼层">
                            <RowLayoutColumnInfo OriginX="5" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="5" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="男" DataType="System.Int32" 
                        IsBound="True" Key="男">
                        <Header Caption="男">
                            <RowLayoutColumnInfo OriginX="6" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="6" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="女" DataType="System.Int32" 
                        IsBound="True" Key="女">
                        <Header Caption="女">
                            <RowLayoutColumnInfo OriginX="7" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="7" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="烘干机" DataType="System.Int32" 
                        IsBound="True" Key="烘干机">
                        <Header Caption="烘干机">
                            <RowLayoutColumnInfo OriginX="8" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="8" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="包间" DataType="System.Int32" 
                        IsBound="True" Key="包间">
                        <Header Caption="包间">
                            <RowLayoutColumnInfo OriginX="9" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="9" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="其他" DataType="System.Int32" 
                        IsBound="True" Key="其他">
                        <Header Caption="其他">
                            <RowLayoutColumnInfo OriginX="10" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="10" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="开始时间" DataType="System.DateTime" 
                        IsBound="True" Key="开始时间">
                        <Header Caption="开始时间">
                            <RowLayoutColumnInfo OriginX="11" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="11" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="结束时间" DataType="System.DateTime" 
                        IsBound="True" Key="结束时间">
                        <Header Caption="结束时间">
                            <RowLayoutColumnInfo OriginX="12" />
                        </Header>
                        <Footer>
                            <RowLayoutColumnInfo OriginX="12" />
                        </Footer>
                    </igtbl:UltraGridColumn>
                </Columns>
            </igtbl:UltraGridBand>
        </bands>
        <displaylayout allowcolsizingdefault="Free" allowcolumnmovingdefault="OnServer" 
            allowdeletedefault="Yes" allowsortingdefault="OnClient" 
            allowupdatedefault="Yes" bordercollapsedefault="Separate" 
            headerclickactiondefault="SortMulti" name="ctl00xUltraWebGrid1" 
            rowheightdefault="20px" rowselectorsdefault="No" 
            selecttyperowdefault="Extended" stationarymargins="Header" 
            stationarymarginsoutlookgroupby="True" tablelayout="Fixed" version="4.00" 
            viewtype="OutlookGroupBy">
            <framestyle backcolor="Window" bordercolor="InactiveCaption" 
                borderstyle="Solid" borderwidth="1px" font-names="Microsoft Sans Serif" 
                font-size="8.25pt" height="200px" width="325px">
            </framestyle>
            <pager minimumpagesfordisplay="2">
                <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                <borderdetails colorleft="White" colortop="White" widthleft="1px" 
                    widthtop="1px" />
                </PagerStyle>
            </pager>
            <editcellstyledefault borderstyle="None" borderwidth="0px">
            </editcellstyledefault>
            <footerstyledefault backcolor="LightGray" borderstyle="Solid" borderwidth="1px">
                <borderdetails colorleft="White" colortop="White" widthleft="1px" 
                    widthtop="1px" />
            </footerstyledefault>
            <headerstyledefault backcolor="LightGray" borderstyle="Solid" 
                horizontalalign="Left">
                <borderdetails colorleft="White" colortop="White" widthleft="1px" 
                    widthtop="1px" />
            </headerstyledefault>
            <rowstyledefault backcolor="Window" bordercolor="Silver" borderstyle="Solid" 
                borderwidth="1px" font-names="Microsoft Sans Serif" font-size="8.25pt">
                <padding left="3px" />
                <borderdetails colorleft="Window" colortop="Window" />
            </rowstyledefault>
            <groupbyrowstyledefault backcolor="Control" bordercolor="Window">
            </groupbyrowstyledefault>
            <groupbybox>
                <boxstyle backcolor="ActiveBorder" bordercolor="Window">
                </boxstyle>
            </groupbybox>
            <addnewbox hidden="False">
                <boxstyle backcolor="Window" bordercolor="InactiveCaption" borderstyle="Solid" 
                    borderwidth="1px">
                    <borderdetails colorleft="White" colortop="White" widthleft="1px" 
                        widthtop="1px" />
                </boxstyle>
            </addnewbox>
            <activationobject bordercolor="" borderwidth="">
            </activationobject>
            <filteroptionsdefault>
                <filterdropdownstyle backcolor="White" bordercolor="Silver" borderstyle="Solid" 
                    borderwidth="1px" customrules="overflow:auto;" 
                    font-names="Verdana,Arial,Helvetica,sans-serif" font-size="11px" height="300px" 
                    width="200px">
                    <padding left="2px" />
                </filterdropdownstyle>
                <filterhighlightrowstyle backcolor="#151C55" forecolor="White">
                </filterhighlightrowstyle>
                <filteroperanddropdownstyle backcolor="White" bordercolor="Silver" 
                    borderstyle="Solid" borderwidth="1px" customrules="overflow:auto;" 
                    font-names="Verdana,Arial,Helvetica,sans-serif" font-size="11px">
                    <padding left="2px" />
                </filteroperanddropdownstyle>
            </filteroptionsdefault>
        </displaylayout>
    </igtbl:UltraWebGrid>
    <igtblexp:UltraWebGridExcelExporter ID="UltraWebGridExcelExporter1" 
        runat="server">
    </igtblexp:UltraWebGridExcelExporter>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
        BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" 
        Caption="&lt;font color=black&gt;我的点位分布信息&lt;/font&gt;" CaptionAlign="Top" 
        CellPadding="4" DataSourceID="SqlDataSource1" Font-Size="12px" Width="100%">
        <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
        <RowStyle BackColor="White" ForeColor="#330099" HorizontalAlign="Center" />
        <Columns>
            <asp:BoundField DataField="类型" HeaderText="类型" SortExpression="类型" />
            <asp:BoundField DataField="城市" HeaderText="城市" SortExpression="城市" />
            <asp:BoundField DataField="分区" HeaderText="分区" SortExpression="分区" />
            <asp:BoundField DataField="地址" HeaderText="地址" SortExpression="地址" />
            <asp:BoundField DataField="类别" HeaderText="类别" SortExpression="类别" />
            <asp:BoundField DataField="档次" HeaderText="档次" SortExpression="档次" />
            <asp:BoundField DataField="点位提供商" HeaderText="点位提供商" SortExpression="点位提供商" />
            <asp:BoundField DataField="楼层" HeaderText="楼层" SortExpression="楼层" />
            <asp:BoundField DataField="男" HeaderText="男" SortExpression="男" />
            <asp:BoundField DataField="女" HeaderText="女" SortExpression="女" />
            <asp:BoundField DataField="烘干机" HeaderText="烘干机" SortExpression="烘干机" />
            <asp:BoundField DataField="包间" HeaderText="包间" SortExpression="包间" />
            <asp:BoundField DataField="其他" HeaderText="其他" SortExpression="其他" />
            <asp:BoundField DataField="开始时间" DataFormatString="{0:d}" HeaderText="开始时间" 
                SortExpression="开始时间" />
            <asp:BoundField DataField="结束时间" DataFormatString="{0:d}" HeaderText="结束时间" 
                SortExpression="结束时间" />
        </Columns>
        <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
    </asp:GridView>
    <asp:Button ID="btnExport" runat="server" onclick="btnExport_Click" 
        Text="导出Excel" />
   <div class="code">客户名称：<asp:Label 
                ID="lbCustomerName" runat="server" ></asp:Label>
            &nbsp;&nbsp;&nbsp; 电话：<asp:Label ID="lbTelPhone" runat="server"></asp:Label>
                &nbsp;&nbsp; 联络人：<asp:Label ID="lbLinkMan" runat="server"></asp:Label>
                &nbsp; 业务范围：<asp:Label ID="lbYewu" runat="server"></asp:Label>
        &nbsp;总需点位数：<asp:Label ID="lbAllPoints" runat="server" Font-Bold="True" 
                ForeColor="#CC3300"></asp:Label>
&nbsp;已分配点位数：<asp:Label ID="lbSumPoints" runat="server" Font-Bold="True" 
                ForeColor="#006600"></asp:Label>
&nbsp;截至日期：<asp:Label ID="lbEndDate" runat="server"></asp:Label>
            <br />
            点位 商家总数：<asp:Label ID="lbSupplierC" runat="server"></asp:Label>
&nbsp;男点位分布：<asp:Label ID="lbManS" runat="server" ></asp:Label>
&nbsp;女点位分布：<asp:Label ID="lbFeMaleS" runat="server" ></asp:Label>
&nbsp;烘干点位分布：<asp:Label ID="lbHongGanS" runat="server" ></asp:Label>
&nbsp;包间点位分布：<asp:Label ID="lbBaoJianS" runat="server" ></asp:Label>
&nbsp;其他点位分布：<asp:Label ID="lbQiTa" runat="server" ></asp:Label>
&nbsp;</div>
</asp:Panel>


